package cn.seqdata.rpt.simple;

import java.util.Collection;
import java.util.HashMap;
import java.util.Map;

import com.google.common.collect.Table;
import com.google.common.collect.TreeBasedTable;

/** 适用于事实表和维度表分开的场景 */
public class CubeTable {
	public final Map<String/* dim */, Table<Object/* col_key */, String/* col_name */, Object/* col_val */>> dims;
	public final Table<Integer/* row_id */, String/* col */, Object/* val */> cells;

	public CubeTable() {
		dims = new HashMap<>();
		cells = TreeBasedTable.create();
	}

	public Collection<Map<String, Object>> getCells() {
		Map<Integer, Map<String, Object>> rowMap = cells.rowMap();
		return rowMap.values();
	}
}
